package dovs.display;

import dovs.node.ABooleanConstExp;
import dovs.node.ACharConstExp;
import dovs.node.AIntConstExp;
import dovs.node.AStringConstExp;

/**
 *	ASTDisplay for the Weeding phase. The display shows the AST with additional
 *	annotation for the field injected in the Weeding phase.
 */
public class WeedingDisplay extends ASTDisplay {
	/**
	 * Constructs an ASTDisplay for the Weeding phase.
	 */
	public WeedingDisplay() {
		super("Weeding");
	}
	
	@Override
	public void outAStringConstExp(AStringConstExp node) {
		// add custom data
		addField(".value", node.value);
		// pop the node from the tree stack
		super.outAStringConstExp(node);
	}
	
	@Override
	public void outAIntConstExp(AIntConstExp node) {
		// add custom data
		addField(".value", node.value);
		// pop the node from the tree stack
		super.outAIntConstExp(node);
	}
	
	@Override
	public void outABooleanConstExp(ABooleanConstExp node) {
		// add custom data
		addField(".value", node.value);
		// pop the node from the tree stack
		super.outABooleanConstExp(node);
	}
	
	@Override
	public void outACharConstExp(ACharConstExp node) {
		// add custom data
		addField(".value", node.value);
		// pop the node from the tree stack
		super.outACharConstExp(node);
	}
}
